package com.dailyblue.java.spring.boot.mvc.mybatis.service.impl;

import com.dailyblue.java.spring.boot.commons.util.JsonResult;
import com.dailyblue.java.spring.boot.commons.bean.Section;
import com.dailyblue.java.spring.boot.commons.util.ResultTool;
import com.dailyblue.java.spring.boot.mvc.mybatis.mapper.SectionMapper;
import com.dailyblue.java.spring.boot.mvc.mybatis.service.SectionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SectionServiceImpl implements SectionService {
    @Resource
    private SectionMapper sectionMapper;

    @Override
    public JsonResult findAllSection() {
        List<Section> list = sectionMapper.findAllSection();
        return ResultTool.success(list);
    }

    @Override
    public JsonResult findSectionById(int id) {
        return ResultTool.success(sectionMapper.findSectionById(id));
    }
}
